<?php
/**
 * Created by IntelliJ IDEA.
 * User: 张伯发
 * Date: 2019/8/2
 * Time: 11:50
 */

namespace App\Common\Util;


use Swoft\Http\Message\Request;

class RequestUtil
{

    /**
     * @param Request $request
     * @return array
     * @throws \ReflectionException
     * @throws \Swoft\Bean\Exception\ContainerException
     * @author 张伯发 2019/8/2 11:52
     */
    public static function HttpBodyMessage(Request $request)
    {
        $result = $request->getBody()->getContents();
        return json_decode($result, true);
    }

}
